from .ssh import SSH


# 用户第一次创建连接某台主机时，校验连接信息的
def valid_ssh(hostname, port, username, password=None):
    # try:
    #     cli = SSH(hostname, porjiaoyt, username, password)
    #     cli.ping()  # 测试该链接是否能够使用
    # except Exception:
    #     return False
    # return True
    test = SSH(hostname, username, port, password)
    return test.ping()
